import * as request from "@/utils/request.js";

export function getRoleList(params, beginTime, endTime) {

    let timeStr = null
    if (beginTime && endTime) {
        timeStr = encodeURI(`params[beginTime]=${beginTime}&params[endTime]=${endTime}`)
    }
    console.log(timeStr)
    return request.get(`/system/role/list?${timeStr}`, params);
}
export function addRole(data){
    return request.postJson("/system/role",data);
}

export function updateRole(data){
    return request.putJson("/system/role",data);
}

export function deleteBatchRole(roleIdList){
    return request.default({
        url:`/system/role/${roleIdList}`,
        method:"delete"
    });
}

export function getRole(roldId){
    return request.get(`/system/role/${roldId}`);
}

